
<?php foreach($comments as $indx=>$comment): ?>
<div class="comment" id="c<?php echo $comment->id; ?>">

	<div class="author">
	<?php if(!Yii::app()->user->isGuest && ($comment->userid == Yii::app()->user->id || Yii::app()->user->role=='admin')){ ?>
		<a href="javascript:void(0)" class="icon button" onclick="deleteComment('<?php echo $comment->id ?>');" title='<?php echo Yii::t('profession_messages','profession.delete'); ?>'>
	    	<?php echo TbHtml::icon(TbHtml::ICON_REMOVE); ?>
	    				
 	  	</a>&nbsp;
 	  	<?php }else {?>
 	  		&nbsp;&nbsp;&nbsp;
 	  	<?php }?>
		<?php echo  $comment->user->username; ?>
	</div>

	<div class="time">
		<?php echo date('F j, Y \a\t h:i a',$comment->created_date); ?>
	</div>

	<div class="content">
		<?php echo nl2br(CHtml::encode($comment->content)); ?>
	</div>

</div><!-- comment -->
<?php endforeach; ?>